package com.lipi.mall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lipi.common.utils.PageUtils;
import com.lipi.mall.member.entity.MemberEntity;
import com.lipi.mall.member.exception.PhoneExistException;
import com.lipi.mall.member.exception.UserNameExistException;
import com.lipi.mall.member.vo.MemberLoginVO;
import com.lipi.mall.member.vo.MemberRegistVO;

import java.util.Map;

/**
 * 会员
 *
 * @author hecy
 * @email kuanih200@163.com
 * @date 2021-06-14 16:05:43
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void regist(MemberRegistVO vo);

    /**
     * 校验手机号是否唯一,若不唯一,抛出异常
     *
     * @param mobile 手机号
     */
    void checkMobileUnique(String mobile) throws PhoneExistException;

    /**
     * 校验用户名是否唯一,若不唯一,抛出异常
     *
     * @param username 用户名
     */
    void checkUsernameUnique(String username) throws UserNameExistException;

    MemberEntity login(MemberLoginVO vo);
}

